<section ng-show="!data.isShochoseproduct">
    <div class="custom">
        <h1>
            订单查询 <span style="color:orange;" ng-if="!data.isShowQueryInfo">(采购单号：{{queryData.purchaseOrderId}})</span>
        </h1>

        <div ng-if="data.isShowQueryInfo">
            <form class="row form-inline" >
                <div class="form-group col-md-2" >
                    <label class="" >订单号</label>
                    <input class=" form-control"  type="input" ng-model="queryData.orderNo" placeholder="订单号" >
                </div>
                <div class="form-group col-md-2">
                    <label class="">采购单号</label>
                    <input class=" form-control" type="number" ng-model="queryData.purchaseOrderId" placeholder="采购单号" value="queryData.purchaseOrderId">
                </div>
                <div class="form-group col-md-2">
                    <label class="">开始日期</label>
                    <input class=" form-control" type="date" ng-model="queryData.ctime_tstart  " placeholder="开始日期" value="queryData.ctime_tstart | date:'yyyy-MM-dd'">
                </div>
                <div class="form-group col-md-2">
                    <label class="">截止日期</label>
                    <input class=" form-control" type="date" ng-model="queryData.ctime_tend" placeholder="截止日期" value="queryData.ctime_tend | date:'yyyy-MM-dd'">
                </div>
                <div class="form-group col-md-2">
                    <label class="">销售人员</label>
                    <select class="form-control" ng-model="x" ng-options="x.realName for x in seller">
                        <option ng-selected="true" value="">选择销售人员</option>
                    </select>
                </div>
                <div class="form-group col-md-2">
                    <label class="">支付方式</label>
                    <select class="form-control" ng-model="queryData.payType">
                        <option value="">选择支付方式</option>
                        <option value="cod">货到付款</option>
                        <option value="wechat">微信支付</option>
                        <option value="linepay">线下支付</option>
                    </select>
                </div>
                <div class="row">
                    <div class="form-group col-md-2" style="margin-top:10px;margin-left:16px;">
                        <button type="button" class="btn btn-warning btn-block" ng-click="orderPrint({id:item.orderId,orderArr:arr})">打印</button>
                    </div>
                    <div class="form-group col-md-2" style="margin-top:10px;margin-left:16px;">
                        <button type="button" class="btn btn-warning btn-block" ng-click="doQuery(x);" >查询</button>
                    </div>
                    <div class="form-group col-md-2" style="margin-top:10px;margin-bottom:10px;">
                        <button type="button"  class="btn btn-warning btn-block" ng-click="export(pay)">导出</button>
                    </div>
                    <div class="form-group col-md-2" style="margin-top:10px;margin-bottom:10px;">
                        <button type="reset"  class="btn btn-default" ng-click="reset()">重置</button>
                    </div>

                </div>
            </form>

        </div>

        <div ng-if="data.isShowDetail">

            <div class="panel panel-default" >

                <div class="panel-heading clearfix">
                    商品列表 订单号：{{data.orderNo}}
                    <div class="btn-group pull-right" role="group" aria-label="...">
                        <button type="button" class="btn btn-success btn-sm" ng-click="data.isShochoseproduct=true;">新增商品</button>
                        <button type="button" class="btn btn-warning btn-sm" ng-click="saveOrderDetailInfo();">全部保存</button>
                        <button type="button" class="btn btn-default btn-sm" ng-click="data.isShowDetail=false;">收起</button>
                    </div>
                </div>

                <table class="table table-bordered panel-body table-hover table-condensed ">

                    <thead>
                    <tr>
                        <th width="10%">#</th>
                        <th width="20%">商品id</th>
                        <th width="20%">商品名称</th>
                        <th width="10%" hidden>单位</th>
                        <!--<th width="20%">订单数量</th>-->
                        <th width="10%">购买数量</th>
                        <th width="10%">实际数量</th>
                        <th width="10%">单价</th>
                        <th width="10%">总价</th>
                        <th width="10%">实际总价</th>
                    </tr>
                    </thead>

                    <tbody>
                    <tr ng-repeat="item in orderDetailList">
                        <th>{{$index+1}}</th>
                        <td>{{item.commodityId}}</td>
                        <td>{{item.commodityName}}</td>
                        <th hidden>{{item.unit}}</th>
                        <!--<td><input type="number" ng-model="item.actualNumber"  ng-show="queryData.orderStatus==0"><span  ng-show="queryData.orderStatus!=0">{{item.actualNumber}}</span></td>-->
                        <td>{{item.number}}{{item.unit}}</td>
                        <td><input type="number" style="width:80px;text-align:center" ng-model="item.trueNumber" ng-blur="updateNumber(item.orderDetailId,item.trueNumber)">{{item.unit}}</td>
                        <td>{{item.unitPrice}}</td>
                        <td>{{item.totalPrice}}</td>
                        <td>{{item.trueTotalPrice}}</td>
                    </tr>

                    </tbody>

                </table>

            </div>


        </div>

        <div class="panel panel-default">

            <div class="panel-heading">
                订单总数：{{totalSize}}
                实际总额:{{trueTotalPrice}}元
            </div>

            <table class="table table-bordered panel-body table-hover table-condensed ">
                <thead>
                <tr>
                    <th>全选：<input type="checkbox"  ng-model="allChecked" ng-change="checkAll(allChecked)"></th>
                    <th>#</th>
                    <th>订单号</th>
                    <th>客户姓名</th>
                    <th>订单总额</th>
                    <th>实际总额</th>
                    <th>订单状态</th>
                    <th>支付方式</th>
                    <th>送货日期</th>
                    <th>分拣完成时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="item in resultList">
                    <td><input type="checkbox" ng-model="isChecked" ng-click="isTrueChecked(isChecked,item.orderId)"></td>
                    <td>{{$index+1}}</td>
                    <td>{{item.orderNo}}</td>
                    <td>{{item.customerName}}</td>
                    <td>{{item.totalPrice}}</td>
                    <td>{{item.trueTotalPrice}}</td>
                    <td>{{item.orderStatus | payStatus}}</td>
                    <td>{{item.payType | payType }}</td>
                    <td>{{item.receivingDate}}</td>
                    <td>{{item.sortFinishTime}}</td>
                    <td>

                        <a ng-click="queryOrderDetail(item.orderId,item.orderNo,item.customerId,item.orderStatus);" href="">详细</a>
                        <a ui-sref="orderPrint({id:item.orderId})">打印</a>

                    </td>
                </tr>
                </tbody>

            </table>

            <div class="panel-footer">

                <nav>
                    <ul class="pager" style="margin:0;">
                        <li><a href="" ng-click="goPrePage();">上一页</a></li>
                        <li>{{pageInfo.currentPage}}/{{pageInfo.totalPageSize}}</li>
                        <li><a href="" ng-click="goNextPage();">下一页</a></li>
                    </ul>
                </nav>

            </div>

        </div>

    </div>

    <div class="slider_right {{ data.isShowGoodSelect ? 'active' : 'default' }} panel panel-default" style="background-color: white;">

        <div class="panel panel-default" >

            <div class="panel-heading clearfix">
                选择商品
            </div>

            <table class="table table-bordered panel-body table-hover table-condensed ">

                <thead>
                <tr>
                    <th width="20%">商品id</th>
                    <th width="50%">商品名称</th>
                    <th width="30%">出售价格</th>
                </tr>
                </thead>

                <tbody>
                <tr ng-repeat="item in goodsResultList" ng-click="addGoods($index);">
                    <td>{{item.commodityId}}</td>
                    <td>{{item.name}}</td>
                    <td>{{item.outPrice}}</td>
                </tr>
                </tbody>

            </table>

            <div class="panel-footer">
                <nav>
                    <ul class="pager" style="margin:0;">
                        <li><a href="" ng-click="goGoodsPrePage();">上一页</a></li>
                        <li>{{goodsPageInfo.currentPage}}/{{goodsPageInfo.totalPageSize}}</li>
                        <li><a href="" ng-click="goGoodsNextPage();">下一页</a></li>
                    </ul>
                </nav>
            </div>
        </div>

    </div>
</section>
<section class="slider_right_lg {{ data.isShochoseproduct ? 'active' : 'default' }}" style="background:#fff">
    <div>
        <button type="button" class="btn btn-sm pull-left" style="margin-left: 15px; margin-top: 14px;"
                ng-click="data.isShochoseproduct=!data.isShochoseproduct">关闭
        </button>
        <choseproduct commoditys="detail.commoditys"></choseproduct>
    </div>
    <table class="table table-bordered panel-body table-hover table-condensed ">
        <thead>
        <tr>
            <th >#</th>
            <th>商品id</th>
            <th>商品名称</th>
            <th >购买数量</th>
            <th >单价</th>
            <th >操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="item in detail.commoditys">
            <th>{{$index+1}}</th>
            <td>{{item.commodityId}}</td>
            <td>{{item.name}}</td>
            <td><input ng-model="item.number"></td>
            <td><input ng-model="item.outPrice"></td>
            <td><a ng-click="removeCart(item.commodityId)">删除</a></td>
        </tr>
        </tbody>
    </table>
    <span ng-show="detail.commoditys.length==0" style="color:red">请选择您要添加的商品：</span>
    <button type="button" class="btn btn-sm-success pull-left" ng-click="addCart()" style="background:#5cb85c;color:#fff;float:right!important">确认添加
    </button>
</section>